version 7.0
log using coxreplication.log, replace
#delimit ;

*     ***************************************************************** *;
*     ***************************************************************** *;
*       File-Name:      coxreplication.do                               *;
*       Date:           1/23/05                                        *;
*       Author:         MRG                                             *;
*       Purpose:        Replicate Amorim Neto and Cox 1997 for CPS      *;
*       Input File:     coxappend.dta                                   *;
*       Output File:    coxreplication.log                              *;
*       Data Output:    coxappend.dta                                   *;
*       Previous file:                                                  *;
*       Machine:                                                        *;
*     ****************************************************************  *;
*     ****************************************************************  *;

set mem 10m;

use "C:\Documents and Settings\Matt Golder\My Documents\fsu\publications\cps2\coxappend.dta", clear;

*use h:\cps\coxappend.dta;

*     ****************************************************************  *;
*           Summary Statistics                                          *;
*     ****************************************************************  *;

sum;

*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*                       Presidential Candidates                         *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*         Can't replicate Cox's results on enpres since he does not     *;
*       include his data on electoral runoffs in his dataset.           *;
*     ****************************************************************  *;


*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*                  Legislative Parties - Table 1 of article             *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;

replace upper=upper*100;

*     ****************************************************************  *;
*                       Generate interaction terms                      *;
*     ****************************************************************  *;

generate enpv_upper = enpv*upper;

generate eneth_upper=eneth*upper;

*     ****************************************************************  *;
*                           Cox's Specification                         *;
*     ****************************************************************  *;

regress enps enpv enpvlml enpv_upper;

*     ****************************************************************  *;
*                            Correct Specification                      *;
*     ****************************************************************  *;

regress enps enpv lnml enpvlml upper enpv_upper;

*     ****************************************************************  *;
*       Note that the coefficient on the interaction term using upper   *;
*       is no longer significant.                                       *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*                   Electoral Parties - Table 2 of article              *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                 Cox's Preferred Specification - Model 5               *;
*     ****************************************************************  *;

regress enpv upper  proximit proxpres lmleneth if drop==0;

*     ****************************************************************  *;
*                I was able to replicate his results exactly.           *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                               Add Enpres                              *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*                       Add interaction term with upper                 *;
*     ****************************************************************  *;

generate uppereneth=upper*eneth;

regress enpv lnml upper enpres  proximit proxpres eneth lmleneth uppereneth if drop==0;

*     ****************************************************************  *;
*       Now let's look at robustness of interaction terms for upper     *;
*       because I don't believe it.  Let's drop Belgium                 *;
*     ****************************************************************  *;

regress enpv lnml upper enpres  proximit  proxpres eneth lmleneth uppereneth if drop==0 & _n~=6;

*     ****************************************************************  *;
*       Interaction term for upper is nowhere near significance now.    *;
*       The result is purely due to Belgium which is a huge outlier as  *;
*       the figures below indicate.  This result does not stand up.     *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*           Redo Cox's original specification without Belgium           *;
*     ****************************************************************  *;

regress enpv lnml upper  proximit  proxpres eneth lmleneth if drop==0 & _n~=6;

*     ****************************************************************  *;
*               Again the results on uppertier disappear.               *;
*     ****************************************************************  *;


*     ****************************************************************  *;
*                            Outlier Analyses                           *;
*     ****************************************************************  *;

regress enpv lnml upper enpres  proximit  proxpres eneth lmleneth uppereneth if drop==0;

predict l, leverage;
graph7 l if e(sample), box symbol([var12]);
*translate @Graph h:\Dissertation\parties\cps\nine.wmf;

predict d, cooksd;
graph7 d if e(sample), box symbol([var12]);
*translate @Graph h:\Dissertation\parties\cps\ten.wmf;

save    coxreplication, replace; exit;
